package logic

import (
	"context"
	"fmt"
	"github.com/hibiken/asynq"
	"go-zero-admin/application/job/rpc/internal/svc"
	"time"
)

type JobHandler struct {
	svcCtx *svc.ServiceContext
}

func NewJobHandler(svcCtx *svc.ServiceContext) *JobHandler {
	return &JobHandler{
		svcCtx: svcCtx,
	}
}

func (l *JobHandler) ProcessTask(ctx context.Context, ta *asynq.Task) error {
	fmt.Printf("demo job -----> %s------%s\n", time.Now(), string(ta.Payload()))

	return nil
}
